package com.easonji.common.constant.enums;

/**
 * @ClassName: UserSexEnum
 * @Description: 用户性别枚举
 * @Author: LiuJun
 * @date: 2018/07/29 15:03
 * @Version: 1.0
 * @Copyright: Copyright (c) 2018 - 2019
 */
public enum UserSexEnum {
    /**
     * 启用
     */
    MAN(1, "男"),
    /**
     * 禁用
     */
    WOMAN(2, "女");

    private Integer code;

    private String message;

    UserSexEnum(Integer code, String message) {
        this.code = code;
        this.message = message;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public static String valueOf(Integer status) {
        if (status == null) {
            return "";
        } else {
            for (UserSexEnum s : UserSexEnum.values()) {
                if (s.getCode() == status) {
                    return s.getMessage();
                }
            }
            return "";
        }
    }
}
